package com.im.session.controller;

import com.im.session.service.SessionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Created leijun
 * @Date 2021/11/9 10:15 下午
 */
@RequestMapping("session")
@RestController
public class SessionController {

    @Autowired
    private SessionService sessionService;

    @RequestMapping(value = "single/create", method = RequestMethod.POST)
    public String createSingleSession(Long user1, Long user2) {
        return sessionService.createSingleSession(user1, user2);
    }

    @RequestMapping(value = "group/create", method = RequestMethod.POST)
    public String createGroupSession(Long senderId, Long groupId) {
        return sessionService.createGroupSession(senderId, groupId);
    }
}
